package com.example.demo.controller;

import com.alibaba.fastjson.JSON;
import com.example.demo.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/getUser/{userId}")
    public String userInfo(@PathVariable Integer userId){
        return JSON.toJSON(userService.getUserInfo(userId)).toString();
    }
}
